// 
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2005 - 2014 Media Design School
//
// File Name	: PlayingCard.h
// Desrciption	: CPlayingCard declaration file.
// Author(s)	: Hayden Asplet.
// Mail			: hayden.asplet@mediadesignschool.com
//

#pragma once

#ifndef __PLAYINGCARD_H__
#define __PLAYINGCARD_H__

// Library Includes

// Local Includes


enum ECardSuit {
	keHearts = 0,
	keSpades = 1,
	keDiamonds = 2,
	keClubs = 3
};

enum ECardValue {
	keAce = 1,
	keTwo = 2,
	keThree = 3,
	keFour = 4,
	keFive = 5,
	keSix = 6,
	keSeven = 7,
	keEight = 8,
	keNine = 9,
	keTen = 10,
	keJack = 11,
	keQueen = 12,
	keKing = 13
};

class CPlayingCard {
	// Member Functions
public:
	// Constructors
	CPlayingCard();
	CPlayingCard(ECardValue _eValue, ECardSuit _eSuit, bool _bIsFaceUp = false);
	CPlayingCard(ECardValue _eValue, ECardSuit _eSuit, const CPoint& _krPosition, bool _bIsFaceUp = false);

	// Destructor
	~CPlayingCard();

	void Flip();	// Toggle the flipped orientation.

	// Comparison Operators

	bool operator==(const CPlayingCard& _krCard) const;	// Only compares value and suit of the card.
	bool operator!=(const CPlayingCard& _krCard) const;	// Only compares value and suit of the card.

	// Accessors
	void SetPosition(const CPoint& _krPosition);
	void SetPosition(const int _kiX, const int _kiY);

	void SetValue(const ECardValue& _kreValue);
	void SetSuit(const ECardSuit& _kreSuit);
	void SetIsFaceUp(bool _bIsFaceUp);
	
	bool IsRed() const;
	bool IsBlack() const;

	CRect GetRect() const;	// Returns a rectangle at the m_position with the standard card 
									// width and height.
	const CPoint& GetPosition() const;

	ECardValue GetValue() const;
	ECardSuit GetSuit() const;
	char* GetSuitString() const;
	bool IsFaceUp() const;
	bool IsFaceDown() const;
protected:
private:

	// Member Variables
public:
protected:
	CPoint m_position;		// Maintains the position of the card; used for mouse input.
	ECardValue m_eValue;
	ECardSuit m_eSuit;
	bool m_bIsFaceUp;		// True if front of the card should be displayed, false otherwise.
private:
};

#endif